<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    


    <script>

        // 循环遍历10000到99999
        for(var i =10000;i<=99999;i++){
            // 取出各个位置的数
                var g = i % 10
                var s = parseInt(i % 100/10)
                var b = parseInt(i % 1000/100)
                var q = parseInt(i % 10000/1000)
                var w = parseInt(i/10000)
                // 取满足回文数条件
                if(g === w && s === q && g + 1 === s && s + 1 === b ){
                    // 打印
                    console.log(i);
                    
                }
        }
    </script>
</body>
</html>